/**
 * 求任意几个数之和
 */
function sum() {
  var len = arguments.length;
  var s = 0;
  for (var i = 0; i < len; i++) {
    if (!isNaN(arguments[i])) {
      //isNaN() 函数用于检查其参数是否是非数字值。
      s += Number(arguments[i]);
    }
  }
  return s;
}

// console.log(sum(1,2,3,4,5));
// console.log(sum(1,2,3,4,5,6,"a","c","7"));
// console.log(sum("a","b","c","d","e"));

function h5Source() {
  let defaultValue = {
      book: "html5布局之路",
      minApp: "决胜前端",
    },
    params = arguments[0];

  for (let prop in params) {
    defaultValue[prop] = params[prop];
  }

  console.log(defaultValue);
}
let params = {
  name: "domain",
  domain: "wwww.baidu.com",
};
h5Source(params);
